<template>
  <div>
    <div class="mui-numbox" data-numbox-min="1">
      <button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
      <input class="mui-numbox-input" type="number" @change="countchend" :value="newCar" ref="mocont">
      <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>
    </div>
  </div>
</template>
<script>
import mui from "../../assets/lib/js/mui.min.js"
export default {
  data(){
    return{

    }
  },
  mounted() {
    mui(".mui-numbox").numbox();
  },
  methods:{
    countchend(){
      /*  var value=mui(".mui-numbox").numbox().getValue() */
    var value=Number(this.$refs.mocont.value)
    console.log(value);
    console.log(this.id);
    
    this.$store.commit("goodsInfo",{id: this.id,count: value})
    }
  },
  props:["newCar","id"]
};
</script>
<style lang="less" scoped>
</style>